package com.mldong.modules.sys.vo;

import cn.hutool.core.lang.Dict;
import cn.hutool.json.JSONUtil;
import com.mldong.modules.sys.entity.Menu;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 菜单
 * </p>
 *
 * @author mldong
 * @since 2023-09-20
 */
@Data
@ApiModel(value = "MenuVO对象", description = "菜单VO")
public class MenuVO extends Menu {
    private Boolean disabled = false;
    @ApiModelProperty(value = "扩展字段")
    private Dict ext = Dict.create();

    public Dict getExt() {
        if(JSONUtil.isTypeJSON(getVariable())){
            ext = JSONUtil.toBean(getVariable(), Dict.class);
        }
        return ext;
    }
}
